8fdfff1339dea3f2568dfcbce5cb5dc07d9220a7,EDIDE/src/ru/compscicenter/edide/StudyUtils.java,StudyUtils,flushWindows,#Document#TaskFile#VirtualFile#,113

Before Change


      String name = file.getNameWithoutExtension() + "_windows";
      PrintWriter printWriter = null;
      try {
        VirtualFile file_windows = taskDir.createChildData(taskFile, name);
        printWriter = new PrintWriter(new FileOutputStream(file_windows.getPath()));
        for (TaskWindow taskWindow : taskFile.getTaskWindows()) {
          int start = taskWindow.getRealStartOffset(document);

After Change


      PrintWriter printWriter = null;
      try {

        file_windows = taskDir.createChildData(taskFile, name);
        printWriter = new PrintWriter(new FileOutputStream(file_windows.getPath()));
        for (TaskWindow taskWindow : taskFile.getTaskWindows()) {
          int start = taskWindow.getRealStartOffset(document);
          String windowDescription = document.getText(new TextRange(start, start + taskWindow.getLength()));
          printWriter.println("#study_plugin_window = " + windowDescription);
        }
      }
      catch (IOException e) {
        e.printStackTrace();
      }
      finally {
        closeSilently(printWriter);
        StudyUtils.synchronize();
      }
    }
    return file_windows;
  }
}